package com.cate.utils;

import com.cate.base.BasePageVO;
import com.cate.pojo.entity.Category;
import com.github.pagehelper.Page;

/**
 * @CreateTime: 2023/7/29
 * @Author: <==lhd==>
 * @Description:
 */
public class PageUtil {

    /**
     * 获得结果
     * @param page
     * @param <T>
     * @return
     */
    public static <T> BasePageVO<T> getPageResult(Page<T> page){
        BasePageVO<T> result = new BasePageVO<>();
        result.setTotal(page.getTotal());
        result.setRecords(page.getResult());
        return result;
    }
}
